package day18.tarena.Thred;

public class MyRunnable implements Runnable {

	public void run() {
		for (int i = 0; i < 10; i++) {
			System.out.println(Thread.currentThread().getName()+":" + i);
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	
	public static void main(String[] args) {
		MyRunnable mr = new MyRunnable();
		Thread t = new Thread(mr);
		t.setDaemon(true);
		t.start(); // t是线程 ,它执行mr的run();
		for (int i = 0; i < 100; i++) {
			System.out.println("main:" + i);
		}
	}
}
